import { defineConfig } from 'vitepress'
import mdItCustomAttrs from 'markdown-it-custom-attrs'
export default defineConfig({
  // base名称要和仓库名称一致
  // base: '/vitepress_Blog',
  // 设置图片点击预览放大的配置
  head: [
    [
      "link",
      { rel: "stylesheet", href: "https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" },
    ],
    ["script", { src: "https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js" }],
    ['link', { rel: 'icon', href: '/logo_paimeng.png' }],
  ],
  // 设置图片点击预览放大的配置
  markdown: {
    config: (md) => {
      // use more markdown-it plugins!
      md.use(mdItCustomAttrs, 'image', {
        'data-fancybox': "gallery"
      })
    }
  },
  // 清除路径后缀,最好设置为false，否则在部署的时候需要额外配置
  cleanUrls: false,
  title: "痞性の博客",
  description: "一个99年小年轻的博客",
  //index.md文件相对于.vitepress所在的目录
  srcDir: './src',
  //主题配置
  themeConfig: {
    // 每一个md文档右边的层级展示，默认是outline：2 只展示二级标题，这里的意思是展示1-6级标题，且默认值label改为目录
    outline: {
      level: [1, 5],
      label: '目录',
    },
    //网站图标配置
    logo: '/logo_paimeng.png',
    // 导航栏设置
    nav: [
      { text: '主页', link: '/' },
      {
        text: '笔记',
        items: [
          {
            text: '前端框架',
            items: [
              { text: 'H5C3', link: '/md/H5C3JS/InterviewQuestions/H5C3JS.md' },
              { text: 'Vue3', link: '/md/Vue/Vue3/Note/Vue3基础语法.md' },
              { text: 'Vue2', link: '/md/Vue/Vue2/Note/Vue2笔记.md' },
              { text: 'React', link: '/md/React/Note/react.md' },
              { text: 'Nginx', link: '/md/Nginx/Note/Nginx.md' },
            ]
          },
          {
            text: '服务端',
            items: [
              { text: 'Nginx', link: '/md/Nginx/Note/Nginx.md' },
              { text: 'Node', link: '/md/Node/Note/Node.md' },
              { text: 'MySQL', link: '/md/Mysql/Note/Mysql.md' },
            ]
          }
        ]
      },
      {
        text: '友链',
        items: [
          {
            items: [
              { text: '痞性の博客', link: 'http://localhost:5173/' },
            ]
          },
        ]
      },
    ],

    //侧边栏配置-针对不同的路径显示不同的侧边栏
    sidebar: {
      '/md/AboutMe/': [
        {
          text: '个人',
          items: [
            { text: '简历', link: '/md/AboutMe/Biography.md' },
            { text: '个人作品', link: '/' },
            // 更多页面...
          ],
        },
      ],
      '/md/Vue': [
        {
          text: 'Vue3笔记',
          collapsed: false,
          items: [
            { text: 'Vue3基础语法', link: '/md/Vue/Vue3/Note/Vue3基础语法.md' },
            { text: 'Vue-Router路由', link: '/md/Vue/Vue3/Note/Vue-Router.md' },
            { text: 'Pinia状态管理', link: '/md/Vue/Vue3/Note/Pinia状态管理.md' },
            { text: 'Vue3的组件通信', link: '/md/Vue/Vue3/Note/Vue3组件通信.md' },
            { text: '其他', link: '/md/Vue/Vue3/Note/其他.md' },
          ],
        },
        {
          text: 'Vue2笔记',
          collapsed: false,
          items: [
            { text: 'Vue2笔记', link: '/md/Vue/Vue2/Note/Vue2笔记.md' },
          ],
        },
        {
          text: '问题收集',
          collapsed: false,
          items: [
            { text: 'Collection', link: '/md/Vue/InterviewQuestions/Vue面试题.md' },
            // 更多页面...
          ],
        },
      ],
       '/md/React': [
        {
          text: '笔记',
          collapsed: false,
          items: [
            { text: 'react笔记', link: '/md/React/Note/react.md' },
            { text: 'react扩展笔记', link: '/md/React/Note/react扩展.md' },
            { text: 'react脚手架配置代理', link: '/md/React/Note/react脚手架配置代理.md' },
          ],
        },
        {
          text: '问题总结',
          collapsed: false,
          items: [
            { text: 'react葵花宝典', link: '/md/React/InterviewQuestions/react葵花宝典.md' },
            // 更多页面...
          ],
        },
       
      ],
       '/md/Mysql': [
        {
          text: '笔记',
          collapsed: false,
          items: [
            { text: 'Mysql笔记', link: '/md/Mysql/Note/Mysql.md' },
          ],
        },
        {
          text: '问题总结',
          collapsed: false,
          items: [
            { text: 'Mysql乾坤大挪移', link: '/md/Mysql/InterviewQuestions/Mysql乾坤大挪移.md' },
            // 更多页面...
          ],
        },
       
      ],
    },

    //外部跳转连接配置
    socialLinks: [
      { icon: 'gitee', link: 'https://gitee.com/whitedonkey/vitepress_Blog.git', },
    ],
    //开启搜索选项
    search: {
      provider: "local",
    },
    //配置页脚
    footer: {
      message: "Released under the 痞性 License.",
      copyright: "Copyright @痞性",
    },
  },
})

